<script setup lang="ts">
import { useThemeStore } from "./store/useThemeStore";
const themeStore = useThemeStore();
useResizeObserver(document.body, () => {
  const width = window.innerWidth;
  const contentWidth = 1200;
  themeStore.$patch({
    // 只有内容宽度<1200的时候才会对宽度做调整
    //  + 是把number转成string
    rate: width < 1200 ? +(width / contentWidth).toFixed(2) : 1,
  });
});
</script>

<template>
  <RouterView />
</template>
